<script language="javascript">
$(document).ready(function() {
   
    $("#1,#2,#3").keyup(function(e) {
        
    //lay gia tri tu input
      var j = new Array();
      for(var i = 1; i<=3;i++){
          if(!($("#"+i).val())){
              j[i]="null"; 
          }
          else {
              j[i]= $("#"+i).val();
          }   
      }
      if(e.keyCode == 13){
        //call get method
         $('#searchrsx').hide();
                $('#searchload').fadeIn(1000).fadeOut(100);
               $('#searchrs').load( 
                   "../search/" + j[1] + "/" + j[2] + "/" + j[3]
                   , function () {                         
                    $(this).show();
                   }); 
            } 
        });
});
</script>
<script>
$(function() {
	$( "#tabs" ).tabs({
	    select: function(event, ui) {
	        var url = $.data(ui.tab, 'load.tabs');
	        if( url ) {
	            location.href = url;
	            return false;
	        }
	        return true;
	    },
	selected: 0
	});
});
</script>
<div id="tabs">
	<ul>
            <li><a href='#tk'>Danh sách tài khoản</a> </li>
               </ul>
<div class="z1users index" id="tk">
	<h2><?php __('Danh sách tài khoản');?></h2>
	<table cellpadding="0" cellspacing="0" id="tables">
	<tr>
	       <th><?php echo 'STT';?></th>
			<th><?php echo 'Username';?></th>
			<th><?php echo 'Họ tên';?></th>
			<th><?php echo 'Chi đoàn';?></th>
			<th class="actions"><?php __('Lựa chọn');?></th>
	</tr>
    
<tr>            
            <td></td>
            <td><?php echo $this->Form->input(1,array('label'=>'','id'=>1));?></td>
            <td><?php echo $this->Form->input(2,array('label'=>'','id'=>2));?></td>
            <td><?php echo $this->Form->input(3,array('label'=>'','id'=>3));?></td>
    </tr>

    
<tbody id="searchrs"><p style="display: none;" id="searchload">Loading</p></tbody>
    <tbody id="searchrsx">

	<?php
	$i = 0;
	foreach ($z1users as $z1user):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
        <td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $z1user['Z1user']['maso']; ?>&nbsp;</td>
		<td><?php echo $z1user['Z1user']['hoten']; ?>&nbsp;</td>
		<td><?php echo $z1user['Z1user']['tenchidoan']; ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Reset password', true), array('controller'=>'users','action' => 'reset', $z1user['Z1user']['id'],$khoa_id)); ?>
			<?php //echo $this->Html->link(__('Sửa', true), array('action' => 'edit', $z1user['Z1user']['id'])); ?>
			<?php echo $this->Html->link(__('Xóa', true), array('action' => 'delete', $z1user['Z1user']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $z1user['Z1user']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</tbody>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, hiện có %count% mẫu tin', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('Trước', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('Sau', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
